package com.kitty.game.rank.model.pojo;

import com.kitty.common.db.BaseEntityGame;
import com.kitty.common.db.Db4CommonService;
import com.kitty.game.equip.model.EquipField;
import lombok.Getter;
import lombok.Setter;
import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;

import java.util.List;

@Getter
@Setter
@Table("t_rankview")
public class RankViewData extends BaseEntityGame<String> {
    @Name
    private String id;
    @Column
    @ColDefine(customType = "longtext")
    private List<EquipField> fieldList;

    public RankViewData() {}

    public RankViewData(String id, List<EquipField> fieldList) {
        this.id = id;
        this.fieldList = fieldList;
    }

    @Override
    public String getId() {
        return id;
    }

    public void save(){
        Db4CommonService.getInstance().add2Queue(this);
    }
}
